package com.code.service.impl;

import com.code.domain.Dish;
import com.code.domain.Type;
import com.code.mapper.DishMapper;
import com.code.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishServiceImpl implements DishService {
    @Autowired
    DishMapper dishMapper;
    @Override
    public Dish search(Integer dishId) {
        return dishMapper.search(dishId);
    }

    @Override
    public int addDish(String dishName, double price , Type dishType,String image) {
        return dishMapper.addDish(dishName , price ,dishType,image);
    }

    @Override
    public int deleteDish(Integer dishId) {
        return dishMapper.deleteDish(dishId);
    }

    @Override
    public int updateDish(Dish dish) {
        return dishMapper.updateDish(dish);
    }

    @Override
    public List<Dish> searchAll() {
        return dishMapper.searchAll();
    }

    @Override
    public List<Dish> searchByType(String dishType) {
        return dishMapper.searchByType(dishType);
    }
}
